package com.mmy.service.oa.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.oa.LeaveTypeRepository;
import com.mmy.domain.oa.LeaveType;
import com.mmy.service.oa.LeaveTypeService;

@Service
public class LeaveTypeServiceImpl implements LeaveTypeService {

	@Autowired
	LeaveTypeRepository leaveTypeRepository;

	/**
	 * 查找全部
	 * 
	 * @param
	 * @return
	 */
	public List<LeaveType> findAll() {
		// TODO Auto-generated method stub
		return leaveTypeRepository.findAll();
	}

	/**
	 * 获取最大值
	 * 
	 * @param
	 * @return
	 */

	public Object getMaxTypeID() {
		// TODO Auto-generated method stub
		return leaveTypeRepository.getMaxTypeID();
	}

	/**
	 * 根据名称查找
	 * 
	 * @param
	 * @return
	 */
	public List<LeaveType> findByTypeName(String strTypeName) {
		// TODO Auto-generated method stub
		return leaveTypeRepository.findByTypeName(strTypeName);
	}

	/**
	 * 新增
	 * 
	 * @param
	 * @return
	 */
	public void save(LeaveType leaveType) {
		// TODO Auto-generated method stub
		leaveTypeRepository.save(leaveType);
	}

	/**
	 * 删除
	 * 
	 * @param
	 * @return
	 */
	public void delLeaveType(List<Integer> lstTypeID) {
		// TODO Auto-generated method stub
		leaveTypeRepository.delLeaveType(lstTypeID);
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */
	public LeaveType findByTypeID(int iTypeID) {
		// TODO Auto-generated method stub
		return leaveTypeRepository.findByTypeID(iTypeID);
	}


	/**
	 * 新增id
	 * 
	 * @param
	 * @return
	 */
	public void save(int typeID) {
		// TODO Auto-generated method stub
		leaveTypeRepository.save(typeID);
	}
}
